﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="adminDeliverData.aspx.cs" Inherits="adminDeliverData" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
        AutoGenerateColumns="False" BackColor="White" 
        BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px" CellPadding="3" 
        DataKeyNames="UserID" DataSourceID="SqlDataSource1" GridLines="Horizontal" 
        Height="158px" style="margin-bottom: 13px" Width="567px">
        <AlternatingRowStyle BackColor="#F7F7F7" />
        <Columns>
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
            <asp:BoundField DataField="UserID" HeaderText="UserID" InsertVisible="False" 
                ReadOnly="True" SortExpression="UserID" />
            <asp:BoundField DataField="CustomerName" HeaderText="CustomerName" 
                SortExpression="CustomerName" />
            <asp:BoundField DataField="AmountPaid" HeaderText="AmountPaid" 
                SortExpression="AmountPaid" />
            <asp:BoundField DataField="DeliveryAddress" HeaderText="DeliveryAddress" 
                SortExpression="DeliveryAddress" />
            <asp:BoundField DataField="DateDelivery" HeaderText="DateDelivery" 
                SortExpression="DateDelivery" />
            <asp:BoundField DataField="DeliverTime" HeaderText="DeliverTime" 
                SortExpression="DeliverTime" />
            <asp:BoundField DataField="Delivery(Y/N)" HeaderText="Delivery(Y/N)" 
                SortExpression="Delivery(Y/N)" />
            <asp:BoundField DataField="cash pay(y/n)" HeaderText="cash pay(y/n)" 
                SortExpression="cash pay(y/n)" />
        </Columns>
        <FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
        <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" />
        <PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" />
        <RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
        <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
        <SortedAscendingCellStyle BackColor="#F4F4FD" />
        <SortedAscendingHeaderStyle BackColor="#5A4C9D" />
        <SortedDescendingCellStyle BackColor="#D8D8F0" />
        <SortedDescendingHeaderStyle BackColor="#3E3277" />
    </asp:GridView>
    <br />
    <br />
    <br />
    <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Back" 
        Width="101px" />
&nbsp;&nbsp;
    <asp:Button ID="Button2" runat="server" onclick="Button2_Click" 
        Text="RegistrationPage" Width="108px" />
&nbsp;&nbsp;
    <asp:Button ID="Button3" runat="server" onclick="Button3_Click" Text="PayData" 
        Width="101px" />
&nbsp;&nbsp;&nbsp;&nbsp;
    <asp:Button ID="Button4" runat="server" onclick="Button4_Click" Text="HomePage" 
        Width="84px" />
    <br />
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:RegConnectionString %>" 
        DeleteCommand="DELETE FROM [DateDelivery] WHERE [UserID] = @UserID" 
        InsertCommand="INSERT INTO [DateDelivery] ([CustomerName], [AmountPaid], [DeliveryAddress], [DateDelivery], [DeliverTime], [Delivery(Y/N)], [cash pay(y/n)]) VALUES (@CustomerName, @AmountPaid, @DeliveryAddress, @DateDelivery, @DeliverTime, @column1, @column2)" 
        SelectCommand="SELECT * FROM [DateDelivery]" 
        UpdateCommand="UPDATE [DateDelivery] SET [CustomerName] = @CustomerName, [AmountPaid] = @AmountPaid, [DeliveryAddress] = @DeliveryAddress, [DateDelivery] = @DateDelivery, [DeliverTime] = @DeliverTime, [Delivery(Y/N)] = @column1, [cash pay(y/n)] = @column2 WHERE [UserID] = @UserID">
        <DeleteParameters>
            <asp:Parameter Name="UserID" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="CustomerName" Type="String" />
            <asp:Parameter Name="AmountPaid" Type="String" />
            <asp:Parameter Name="DeliveryAddress" Type="String" />
            <asp:Parameter Name="DateDelivery" Type="String" />
            <asp:Parameter Name="DeliverTime" Type="String" />
            <asp:Parameter Name="column1" Type="String" />
            <asp:Parameter Name="column2" Type="String" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="CustomerName" Type="String" />
            <asp:Parameter Name="AmountPaid" Type="String" />
            <asp:Parameter Name="DeliveryAddress" Type="String" />
            <asp:Parameter Name="DateDelivery" Type="String" />
            <asp:Parameter Name="DeliverTime" Type="String" />
            <asp:Parameter Name="column1" Type="String" />
            <asp:Parameter Name="column2" Type="String" />
            <asp:Parameter Name="UserID" Type="Int32" />
        </UpdateParameters>
    </asp:SqlDataSource>
    <br />
</asp:Content>

